package com.huluobo.a2303mdmdemo.demo

import android.util.Log
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

/**
 *  Created by LC on 2025/8/14.
 *  @Composable 标记一个方法是compost的控件,可以作为视图使用
 *  modifier 属性集合
 *  compost 中所有的dp sp 都是.dp的形式
 *  clickable 点击事件
 *  background 背景颜色,形状 RoundedCornerShape 圆角 CircleShape 圆形
 *  fillMaxSize 充满最大尺寸 fillMaxWidth 充满最大宽
 *  textAlign 文本的位置
 *  color 文本颜色
 *  fontWeight 字体权重
 *  fontSize 字体大小
 *
 *  Column 纵向布局
 *
 */

@Composable
fun MyText() {
    Row(
        modifier = Modifier
            .fillMaxWidth()
            .fillMaxHeight(),
        //纵向位置,与Column相反
        verticalAlignment = Alignment.CenterVertically,
        //横向的排列
        horizontalArrangement = Arrangement.SpaceBetween
    ) {
        Text(text = "12")
        Text(text = "12")
        Text(text = "12")
        Text(text = "12")
        Text(text = "12")
        Text(text = "12")
    }

//    Column(
//        modifier = Modifier
//            .padding(10.dp)
//            .fillMaxSize(),
//        //纵向的排列,一般使用spacedBy(间距) SpaceBetween平均分配剩余空间并且占据两头位置,SpaceAround平均分配剩余空间,不会占据两头位置
//        verticalArrangement = Arrangement.SpaceAround,
//        //横向位置,一般使用居中或者左对齐
//        horizontalAlignment = Alignment.CenterHorizontally
//    ) {
//        Text(
//            text = "你好",
//            modifier = Modifier
//                .padding(10.dp)
//                .clickable {
//                    Log.e("TagA", "点击了文本")
//                }
//                .background(Color.Red, CircleShape)
//                .height(100.dp)
//                .width(100.dp),
//            textAlign = TextAlign.Center,
//            color = Color.White,
//            fontSize = 22.sp,
//            fontWeight = FontWeight.Bold,
//        )
//        Text(
//            text = "你好呀asd123812736938472934092384092384092734982634987230948203948093284023",
//            fontSize = 20.sp,
//            fontFamily = FontFamily.Default,
//            //行数
//            maxLines = 1,
//            //超出部分如何展示
//            overflow = TextOverflow.Ellipsis,
//            //字符间距
//            letterSpacing = 10.sp,
//        )
//        Text(
//            text = "你好呀asd123812736938472934092384092384092734982634987230948203948093284023",
//            fontSize = 20.sp,
//            fontFamily = FontFamily.Serif,
//            //行数
//            maxLines = 1,
//            //超出部分如何展示
//            overflow = TextOverflow.Ellipsis,
//            //字符间距
//            letterSpacing = 10.sp
//        )
//        Text(
//            text = "你好呀asd123812736938472934092384092384092734982634987230948203948093284023",
//            fontSize = 20.sp,
//            fontFamily = FontFamily.Cursive,
//            //行数
//            maxLines = 1,
//            //超出部分如何展示
//            overflow = TextOverflow.Ellipsis,
//            //字符间距
//            letterSpacing = 10.sp
//        )
//        Text(
//            text = "你好呀asd123812736938472934092384092384092734982634987230948203948093284023",
//            fontSize = 20.sp,
//            fontFamily = FontFamily.Monospace,
//            //行数
//            maxLines = 1,
//            //超出部分如何展示
//            overflow = TextOverflow.Ellipsis,
//            //字符间距
//            letterSpacing = 10.sp
//        )
//        Text(
//            text = "你好呀asd123812736938472934092384092384092734982634987230948203948093284023",
//            fontSize = 20.sp,
//            fontFamily = FontFamily.SansSerif,
//            //行数
//            maxLines = 1,
//            //超出部分如何展示
//            overflow = TextOverflow.Ellipsis,
//            //字符间距
//            letterSpacing = 10.sp
//        )
//    }
}